-- =============================================
-- get stored procedure 
-- =============================================


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProducts_By_Category' 
)
   DROP PROCEDURE ECommerce_GetProducts_By_Category
GO

CREATE PROCEDURE ECommerce_GetProducts_By_Category
	@CategoryID	int
AS
	SELECT * FROM dbo.Product
	WHERE ProductID IN (SELECT ProductID FROM dbo.Product_Category_Mapping WHERE CategoryID=@CategoryID OR CategoryID in (SELECT CategoryID FROM dbo.Category WHERE ParentCategoryID=@CategoryID))
	ORDER BY CreatedOn DESC

GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProducts_By_Tag' 
)
   DROP PROCEDURE ECommerce_GetProducts_By_Tag
GO

CREATE PROCEDURE ECommerce_GetProducts_By_Tag
	@TagID	int
AS
	SELECT * FROM dbo.Product
	WHERE ProductID IN (SELECT ProductID FROM dbo.ProductTag_Product_Mapping WHERE ProductTagID=@TagID)
	ORDER BY CreatedOn DESC
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetPictures_By_Product' 
)
   DROP PROCEDURE ECommerce_GetPictures_By_Product
GO

CREATE PROCEDURE ECommerce_GetPictures_By_Product
	@ProductID	int
AS
	SELECT * FROM dbo.Picture
	WHERE PictureID IN (SELECT PictureID FROM dbo.ProductPicture WHERE ProductID=@ProductID)
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetDocuments_By_Product' 
)
   DROP PROCEDURE ECommerce_GetDocuments_By_Product
GO

CREATE PROCEDURE ECommerce_GetDocuments_By_Product
	@ProductID	int
AS
	SELECT * FROM [dbo].[Document]
	WHERE DocumentID IN (SELECT DocumentID FROM dbo.Product_Document_Mapping WHERE ProductID=@ProductID)
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProductReviews_By_Product' 
)
   DROP PROCEDURE ECommerce_GetProductReviews_By_Product
GO

CREATE PROCEDURE ECommerce_GetProductReviews_By_Product
	@ProductID	int
AS
	SELECT * FROM dbo.ProductReview
	WHERE ProductID = @ProductID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProductRatings_By_Product' 
)
   DROP PROCEDURE ECommerce_GetProductRatings_By_Product
GO

CREATE PROCEDURE ECommerce_GetProductRatings_By_Product
	@ProductID	int
AS
	SELECT * FROM dbo.ProductRating
	WHERE ProductID = @ProductID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetRelatedProducts' 
)
   DROP PROCEDURE ECommerce_GetRelatedProducts
GO

CREATE PROCEDURE ECommerce_GetRelatedProducts
	@ProductID	int
AS
	SELECT * FROM dbo.RelatedProduct
	WHERE ProductID1=@ProductID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProduct' 
)
   DROP PROCEDURE ECommerce_GetProduct
GO

CREATE PROCEDURE ECommerce_GetProduct
	@ProductID	int
AS
	SELECT * FROM dbo.Product
	WHERE ProductID=@ProductID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProductAdditionalProperties' 
)
   DROP PROCEDURE ECommerce_GetProductAdditionalProperties
GO

CREATE PROCEDURE ECommerce_GetProductAdditionalProperties
	@ProductID	int
AS
	SELECT * FROM dbo.ProductAdditionalProperty
	WHERE ProductID=@ProductID
	ORDER BY DisplayOrder
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetAllLanguages' 
)
   DROP PROCEDURE ECommerce_GetAllLanguages
GO

CREATE PROCEDURE ECommerce_GetAllLanguages
AS
	SELECT * FROM [dbo].[Language]
	ORDER BY DisplayOrder
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProductCategory_By_Language' 
)
   DROP PROCEDURE ECommerce_GetProductCategory_By_Language
GO

CREATE PROCEDURE ECommerce_GetProductCategory_By_Language
	@LanguageID int
AS
	SELECT * FROM [dbo].[Category]
	WHERE LanguageID=@LanguageID
	ORDER BY DisplayOrder
GO

-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetSubCategories' 
)
   DROP PROCEDURE ECommerce_GetSubCategories
GO

CREATE PROCEDURE ECommerce_GetSubCategories
	@ParentCategoryID int
AS
	SELECT * FROM [dbo].[Category]
	WHERE ParentCategoryID=@ParentCategoryID
	ORDER BY DisplayOrder
GO

-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheCategory' 
)
   DROP PROCEDURE ECommerce_GetTheCategory
GO

CREATE PROCEDURE ECommerce_GetTheCategory
	@CategoryID int
AS
	SELECT * FROM [dbo].[Category]
	WHERE CategoryID=@CategoryID
	ORDER BY DisplayOrder
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProductTag_By_Language' 
)
   DROP PROCEDURE ECommerce_GetProductTag_By_Language
GO

CREATE PROCEDURE ECommerce_GetProductTag_By_Language
	@LanguageID int
AS
	SELECT * FROM [dbo].[ProductTag] WHERE LanguageID=@LanguageID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetLocalStringResource_By_Language' 
)
   DROP PROCEDURE ECommerce_GetLocalStringResource_By_Language
GO

CREATE PROCEDURE ECommerce_GetLocalStringResource_By_Language
	@LanguageID	int
AS
	SELECT * FROM [dbo].[LocalStringResource]
	WHERE LanguageID=@LanguageID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetAllCountry' 
)
   DROP PROCEDURE ECommerce_GetAllCountry
GO

CREATE PROCEDURE ECommerce_GetAllCountry
AS
	SELECT * FROM [dbo].[Country]
	ORDER BY DisplayOrder
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetStateProvince_By_Country' 
)
   DROP PROCEDURE ECommerce_GetStateProvince_By_Country
GO

CREATE PROCEDURE ECommerce_GetStateProvince_By_Country
	@CountryID	int
AS
	SELECT * FROM [dbo].[StateProvince]
	WHERE CountryID=@CountryID
	ORDER BY DisplayOrder
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetShoppingCartType' 
)
   DROP PROCEDURE ECommerce_GetShoppingCartType
GO

CREATE PROCEDURE ECommerce_GetShoppingCartType
AS
	SELECT * FROM [dbo].[ShoppingCartType]
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetShoppingCartItem_By_User' 
)
   DROP PROCEDURE ECommerce_GetShoppingCartItem_By_User
GO

CREATE PROCEDURE ECommerce_GetShoppingCartItem_By_User
	@UserID	uniqueidentifier
AS
	SELECT * FROM [dbo].[ShoppingCartItem]
	WHERE UserID=@UserID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetExpress' 
)
   DROP PROCEDURE ECommerce_GetExpress
GO

CREATE PROCEDURE ECommerce_GetExpress
AS
	SELECT * FROM [dbo].[Express]
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetCity_By_StateProvince' 
)
   DROP PROCEDURE ECommerce_GetCity_By_StateProvince
GO

CREATE PROCEDURE ECommerce_GetCity_By_StateProvince
	@StateProvinceID	int
AS
	SELECT * FROM [dbo].[City]
	WHERE StateProvinceID=@StateProvinceID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetPaymentMethod' 
)
   DROP PROCEDURE ECommerce_GetPaymentMethod
GO

CREATE PROCEDURE ECommerce_GetPaymentMethod
AS
	SELECT * FROM [dbo].[PaymentMethod]
	ORDER BY DisplayOrder
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetPaymentStatus' 
)
   DROP PROCEDURE ECommerce_GetPaymentStatus
GO

CREATE PROCEDURE ECommerce_GetPaymentStatus
AS
	SELECT * FROM [dbo].[PaymentStatus]
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetShippingMethod' 
)
   DROP PROCEDURE ECommerce_GetShippingMethod
GO

CREATE PROCEDURE ECommerce_GetShippingMethod
AS
	SELECT * FROM [dbo].[ShippingMethod]
	ORDER BY DisplayOrder
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetShippingStatus' 
)
   DROP PROCEDURE ECommerce_GetShippingStatus
GO

CREATE PROCEDURE ECommerce_GetShippingStatus
AS
	SELECT * FROM [dbo].[ShippingStatus]
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetOrder_By_User' 
)
   DROP PROCEDURE ECommerce_GetOrder_By_User
GO

CREATE PROCEDURE ECommerce_GetOrder_By_User
	@UserID	uniqueidentifier
AS
	SELECT * FROM [dbo].[Order]
	WHERE UserID = @UserID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetOrderNote_By_Order' 
)
   DROP PROCEDURE ECommerce_GetOrderNote_By_Order
GO

CREATE PROCEDURE ECommerce_GetOrderNote_By_Order
	@OrderID	int
AS
	SELECT * FROM [dbo].[OrderNote]
	WHERE OrderID = @OrderID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetOrderStatus' 
)
   DROP PROCEDURE ECommerce_GetOrderStatus
GO

CREATE PROCEDURE ECommerce_GetOrderStatus
AS
	SELECT * FROM [dbo].[OrderStatus]
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetUserExtension_By_UserID' 
)
   DROP PROCEDURE ECommerce_GetUserExtension_By_UserID
GO

CREATE PROCEDURE ECommerce_GetUserExtension_By_UserID
	@UserID	uniqueidentifier
AS
	SELECT * FROM [dbo].[UserExtension]
	WHERE UserID = @UserID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetPicture_By_PictureID' 
)
   DROP PROCEDURE ECommerce_GetPicture_By_PictureID
GO

CREATE PROCEDURE ECommerce_GetPicture_By_PictureID
	@PictureID	int
AS
	SELECT * FROM [dbo].[Picture]
	WHERE PictureID = @PictureID
GO

-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheUserAddresses' 
)
   DROP PROCEDURE ECommerce_GetTheUserAddresses
GO

CREATE PROCEDURE ECommerce_GetTheUserAddresses
	@UserID	uniqueidentifier
AS
	SELECT * FROM [dbo].[Address]
	WHERE UserID = @UserID
GO

-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetNews_By_Language' 
)
   DROP PROCEDURE ECommerce_GetNews_By_Language
GO

CREATE PROCEDURE ECommerce_GetNews_By_Language
	@LanguageID	int
AS
	SELECT * FROM [dbo].[News]
	WHERE LanguageID = @LanguageID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProductPicture_By_Product' 
)
   DROP PROCEDURE ECommerce_GetProductPicture_By_Product
GO

CREATE PROCEDURE ECommerce_GetProductPicture_By_Product
	@ProductID	int
AS
	SELECT * FROM [dbo].[ProductPicture]
	WHERE ProductID = @ProductID
	ORDER BY DisplayOrder
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheShoppingCartItem' 
)
   DROP PROCEDURE ECommerce_GetTheShoppingCartItem
GO

CREATE PROCEDURE ECommerce_GetTheShoppingCartItem
	@ShoppingCartItemID	int
AS
	SELECT * FROM [dbo].[ShoppingCartItem]
	WHERE ShoppingCartItemID = @ShoppingCartItemID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheOrderProducts' 
)
   DROP PROCEDURE ECommerce_GetTheOrderProducts
GO

CREATE PROCEDURE ECommerce_GetTheOrderProducts
	@OrderID	int
AS
	SELECT * FROM [dbo].[Product]
	WHERE ProductID IN ( SELECT ProductID FROM [dbo].[Order_Product_Mapping] WHERE OrderID=@OrderID )
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTopSellingProducts' 
)
   DROP PROCEDURE ECommerce_GetTopSellingProducts
GO

CREATE PROCEDURE ECommerce_GetTopSellingProducts
AS
	SELECT * FROM [dbo].[Product]
	WHERE ProductID IN (SELECT ProductID FROM ( SELECT TOP(10) ProductID, SUM(Quantity) AS SoldProducts FROM [dbo].[Order_Product_Mapping]
						 GROUP BY ProductID
						 ORDER BY SoldProducts DESC ) AS TBTopSelling10
						)
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheProductDefaultPicture' 
)
   DROP PROCEDURE ECommerce_GetTheProductDefaultPicture
GO

CREATE PROCEDURE ECommerce_GetTheProductDefaultPicture
	@ProductID	int
AS
	SELECT * FROM dbo.Picture
	WHERE PictureID = ( SELECT TOP(1) PictureID FROM dbo.ProductPicture WHERE ProductID=@ProductID ORDER BY DisplayOrder )
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetShippingMethod_By_Product' 
)
   DROP PROCEDURE ECommerce_GetShippingMethod_By_Product
GO

CREATE PROCEDURE ECommerce_GetShippingMethod_By_Product
	@ProductID	int
AS
	SELECT * FROM dbo.ShippingMethod
	WHERE ShippingMethodID IN (SELECT ShippingMethodID FROM dbo.Product_ShippingMethod_Mapping WHERE ProductID=@ProductID)
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheShippingByStateAndProvince' 
)
   DROP PROCEDURE ECommerce_GetTheShippingByStateAndProvince
GO

--CREATE PROCEDURE ECommerce_GetTheShippingByStateAndProvince
--	@ShippingMethodID	int,
--	@StateAndProvinceID	int
--AS
--	SELECT * FROM dbo.ShippingByStateAndProvince
--	WHERE ShippingMethodID=@ShippingMethodID AND StateAndProvinceID=@StateAndProvinceID
--GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetShippingByStateAndProvince_By_Province' 
)
   DROP PROCEDURE ECommerce_GetShippingByStateAndProvince_By_Province
GO

CREATE PROCEDURE ECommerce_GetShippingByStateAndProvince_By_Province
	@StateAndProvinceID	int
AS
	SELECT * FROM dbo.ShippingByStateAndProvince
	WHERE StateAndProvinceID=@StateAndProvinceID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheOrder_By_OrderID' 
)
   DROP PROCEDURE ECommerce_GetTheOrder_By_OrderID
GO

CREATE PROCEDURE ECommerce_GetTheOrder_By_OrderID
	@OrderID	int
AS
	SELECT * FROM [dbo].[Order]
	WHERE OrderID=@OrderID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetOrder_Product_Mapping_By_OrderID' 
)
   DROP PROCEDURE ECommerce_GetOrder_Product_Mapping_By_OrderID
GO

CREATE PROCEDURE ECommerce_GetOrder_Product_Mapping_By_OrderID
	@OrderID	int
AS
	SELECT * FROM [dbo].[Order_Product_Mapping]
	WHERE OrderID=@OrderID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheOrder_By_OrderNumber' 
)
   DROP PROCEDURE ECommerce_GetTheOrder_By_OrderNumber
GO

CREATE PROCEDURE ECommerce_GetTheOrder_By_OrderNumber
	@OrderNumber	nvarchar(13)
AS
	SELECT * FROM [dbo].[Order]
	WHERE OrderNumber = @OrderNumber
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetTheOrderStatus_By_StatusName' 
)
   DROP PROCEDURE ECommerce_GetTheOrderStatus_By_StatusName
GO

CREATE PROCEDURE ECommerce_GetTheOrderStatus_By_StatusName
	@StatusName	nvarchar(100)
AS
	SELECT * FROM [dbo].[OrderStatus]
	WHERE Name = @StatusName
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetCashTicket_By_User' 
)
   DROP PROCEDURE ECommerce_GetCashTicket_By_User
GO

CREATE PROCEDURE ECommerce_GetCashTicket_By_User
	@UserID	uniqueidentifier
AS
	SELECT * FROM [dbo].[CashTicket]
	WHERE UserID = @UserID
GO


-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_NAME = N'ECommerce_GetProducts_By_Language' 
)
   DROP PROCEDURE ECommerce_GetProducts_By_Language
GO

CREATE PROCEDURE ECommerce_GetProducts_By_Language
	@LanguageID	int
AS
	SELECT * FROM dbo.Product
	WHERE LanguageID=@LanguageID
	ORDER BY CreatedOn DESC

GO

